<!--
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 14:41:20
 * @LastEditTime: 2023-11-09 17:01:33
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description:   :gridOps="gridOptions" other
-->
<template>
	<sc-VxeTable
		ref="xGrid"
		:tablecode="'pro_storage_index'"
		:gridEvts="gridEvents"
		:url="api.pro.wip.list"
	>
	</sc-VxeTable>
	<WIPSwipe
		v-if="dialog.swipe"
		ref="swipe"
		@success="handleSuccess"
		@closed="dialog.swipe = false"
	>
	</WIPSwipe>
</template>
<script>
export default {
	name: "pro_storage",
};
</script>
<script setup>
import { nextTick, ref } from "vue";
import api from "@/api";
import WIPSwipe from "./WIPSwipe";
const xGrid = ref({});
const swipe = ref({});
const dialog = ref({
	swipe: false,
});
const handleSuccess = () => {
	xGrid.value.refresh();
};
const gridEvents = {
	swip: ({ button }) => {
		dialog.value.swipe = true;
		nextTick(() => {
			swipe.value.setData(button.selectRecords[0]).open();
		});
	},
};
</script>
